package com.school.empsys.dto;

import com.school.empsys.constants.ResponseState;

import java.io.Serializable;

public class ResponseInfo implements Serializable {

	private static final long serialVersionUID = -4417715614021482064L;

	private String code;
	private String message;
	private Object data;

	public static ResponseInfo SUCCESS = new ResponseInfo().code(ResponseState.SUCCESS.getCode());
	public static ResponseInfo FAILURE = new ResponseInfo().code(ResponseState.FAILURE.getCode());
	public static ResponseInfo CONFIRM = new ResponseInfo().code(ResponseState.CONFIRM.getCode());

	public ResponseInfo() {}

	public ResponseInfo(String code, String message) {
		super();
		this.code = code;
		this.message = message;
	}

	public ResponseInfo(String code, String message, Object data) {
		super();
		this.code = code;
		this.message = message;
		this.data = data;
	}

	public ResponseInfo code(String code) {
		this.code = code;
		return this;
	}

	public ResponseInfo message(String message) {
		this.message = message;
		return this;
	}

	public ResponseInfo data(Object data) {
		this.data = data;
		return this;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
}
